<%@ page import="homework.Role" %>
<%@ page import="java.util.List" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>角色列表</title>
</head>
<body>
<table border="1px" width="600px" align="center" cellspacing="0" cellpadding="10px">
<caption>角色列表</caption>
<tr>
    <a href="${pageContext.request.contextPath}/day35homeWork/addRole.jsp">添加数据</a>
</tr>
<tr>
    <th>序号</th>
    <th>角色名</th>
    <th>角色年龄</th>
    <th>角色地址</th>
    <th>角色爱好</th>
    <th>角色性别</th>
    <th>角色生日</th>
    <th>操作</th>
</tr>

<c:if test="${roleList != null and roleList.size() != 0}">
    <c:forEach items="${roleList}" var="role" varStatus="status">

        <tr>
            <td>${status.count}</td>
            <td>${role.username}</td>
            <td>${role.age}</td>
            <td>${role.address}</td>
<%--            <td>${role.hobby}</td>&lt;%&ndash;怎么改&ndash;%&gt;--%>
            <td><c:forEach items="${role.hobby}" var="hobby" varStatus="status">${hobby}</c:forEach></td>
            <td>${role.sex}</td>
            <td>${role.birthday}</td>
            <td>
                <a href="${pageContext.request.contextPath}/day35homeWork/editRole.action">编辑</a>
                <a href="${pageContext.request.contextPath}/day35homeWork/deleteRole.action">删除</a>
            </td>
        </tr>
    </c:forEach>
</c:if>
</table>>
</body>
</html>
